﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace 算法
{
    class Stack1
    {
        public static void Get8Jinzhi()
        {
            Console.WriteLine("输入十进制数");
            int int10 = 0;
            int10=Convert.ToInt32(Console.ReadLine());
            int inttemp = int10;


            Stack s = new Stack();
            while (int10!=0)
            {
                s.Push(int10 % 8);
                int10 = int10 / 8;

            }

            string strResult="";
            while (s.Count != 0)
            {
                strResult += s.Pop().ToString();

            }

            Console.WriteLine(strResult+"\n");


            try
            {
                string ss = inttemp.ToString();
                ss = Convert.ToString(int.Parse(ss), 8);

                Console.WriteLine(ss);
            }
            catch { }
        }


    }
}
